package com.sinosoft.content;

public class ContentCommon {
	
	public ContentCommon(){
		
	}
	
	/**
	 * 把ContentView或ContentEn转换成Content
	 * @param en
	 * @param vo
	 * @return
	 */
	public static Content toZh(ContentEn en,ContentView vo){
		Content zh=null;
		if(null!=en){
			zh=new Content();
			zh.setContentId(en.getContentId());
			zh.setContent(en.getContent());
			zh.setContentId(en.getContentId());
			zh.setContentTime(en.getContentTime());
			zh.setContentTitle(en.getContentTitle());
			zh.setContentType(en.getContentType());
			zh.setIsRelease(en.getIsRelease());
		}
		if(null!=vo){
			zh=new Content();
			zh.setContentId(vo.getContentId());
			zh.setContent(vo.getContent());
			zh.setContentId(vo.getContentId());
			zh.setContentTime(vo.getContentTime());
			zh.setContentTitle(vo.getContentTitle());
			zh.setContentType(vo.getContentType());
			zh.setIsRelease(vo.getIsRelease());
		}
		return zh;
		
	}
	
	/**
	 * 把ContentView或Content转换成ContentEn
	 * @param zh
	 * @param vo
	 * @return
	 */
	public static ContentEn toEn(Content zh,ContentView vo){
		ContentEn en=null;
		if(null!=zh){
			en=new ContentEn();
			en.setContentId(zh.getContentId());
			en.setContent(zh.getContent());
			en.setContentId(zh.getContentId());
			en.setContentTime(zh.getContentTime());
			en.setContentTitle(zh.getContentTitle());
			en.setContentType(zh.getContentType());
			en.setIsRelease(zh.getIsRelease());
		}
		if(null!=vo){
			en=new ContentEn();
			en.setContentId(vo.getContentId());
			en.setContent(vo.getContent());
			en.setContentId(vo.getContentId());
			en.setContentTime(vo.getContentTime());
			en.setContentTitle(vo.getContentTitle());
			en.setContentType(vo.getContentType());
			en.setIsRelease(vo.getIsRelease());
		}
		return en;
	}
	
	/**
	 * 把ContentEn或Content转换成ContentView
	 * @param zh
	 * @param en
	 * @return
	 */
	public static ContentView toVo(Content zh,ContentEn en){
		ContentView vo=null;
		if(null!=zh){
			vo=new ContentView();
			vo.setContentId(zh.getContentId());
			vo.setContent(zh.getContent());
			vo.setContentId(zh.getContentId());
			vo.setContentTime(zh.getContentTime());
			vo.setContentTitle(zh.getContentTitle());
			vo.setContentType(zh.getContentType());
			vo.setIsRelease(zh.getIsRelease());
		}
		if(null!=en){
			vo=new ContentView();
			vo.setContentId(en.getContentId());
			vo.setContent(en.getContent());
			vo.setContentId(en.getContentId());
			vo.setContentTime(en.getContentTime());
			vo.setContentTitle(en.getContentTitle());
			vo.setContentType(en.getContentType());
			vo.setIsRelease(en.getIsRelease());
		}
		return vo;
	}
}
